package com.task.controller;

import com.task.common.ReturnResult;
import com.task.pojo.ChatContent;
import com.task.server.ChatRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jiafujun
 * 2020年03月26日 13:51:00
 */
@RestController
@RequestMapping("/chatRecord")
public class ChatRecordController {

    @Autowired
    private ChatRecordService chatRecordService;

    @RequestMapping(value = "/getRecord", method = RequestMethod.POST)
    public ReturnResult getRecord(Integer userId1, Integer userId2, String dateTime) {
        List<ChatContent> data = chatRecordService.selectRecord(userId1, userId2, dateTime);
        return ReturnResult.ok(data);
    }
}
